package com.service;

import com.dao.Accountdao;
import com.domain.Account;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import java.util.List;
@Service
public class AccountserviceImpl implements Accountservice {
    @Autowired
private Accountdao accountdao;
    @Override
    public List<Account> saveAccount() {
        System.out.println("com/service");
        return accountdao.saveAccount();
    }

    @Override
    public Account findbyid(Integer id) {
        return accountdao.findbyid(id);
    }

    @Override
    public int update(Account account) {
        return accountdao.update(account);
    }

    @Override
    public int delete(Integer id) {
        return accountdao.delete(id);
    }

    @Override
    public int sace(Account account) {
        return accountdao.sace(account);
    }

    @PostConstruct
    public void init(){
        System.out.println("开始");
    }
    @PreDestroy
    public void edn(){
        System.out.println("销毁");
    }
}
